import App from './App'
import messages from './locale/index'

let i18nConfig = {
  locale: uni.getLocale(),
  messages
}


// #ifndef VUE3
import Vue from 'vue'
import VueI18n from 'vue-i18n'
Vue.use(VueI18n)
const i18n = new VueI18n(i18nConfig)
Vue.config.productionTip = false
console.log("location.host",location)
let envVersion = uni.getAccountInfoSync && uni.getAccountInfoSync().miniProgram.envVersion

// Vue.prototype.$api = process.env.NODE_ENV == 'production'? 'http://206.237.4.16:8086':"http://192.168.1.44:8086"//location.origin 
Vue.prototype.$api = process.env.NODE_ENV == 'production'? 'https://apitravel.y83.com':"http://192.168.1.44:8086"//location.origin 
Vue.config.$api = window.location.origin
App.mpType = 'app'
const app = new Vue({
  ...App,
  i18n,
})  

app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import { createI18n } from 'vue-i18n'
const i18n = createI18n(i18nConfig)
export function createApp() {
  const app = createSSRApp(App)
  app.use(i18n)
  return {
    app
  }
}
// #endif
